/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package horde.minefield.arturo;

import horde.control.AutomatonBehavior;
import horde.interfaces.Requests;
import horde.minefield.andres.agentSmithCoreTest;
import horde.patterns.Agent;
import horde.patterns.master.MasterAgent;
import horde.internalResources.HorrorControl.HorrorControl;
import horde.internalResources.horrorControl.HCvis.horrorControlGraphics;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;

/**
 *
 * @author Arturo Mazón
 */
public class hcvisualTest {

    
    @SuppressWarnings("static-access")
    public static void test(){
        HorrorControl hc = HorrorControl.getInstance();
        
        PruebahcVisual v = new PruebahcVisual (hc);
        MasterAgent the_architect = new MasterAgent("Architect");
        hc.trace("the_architect", "Master Created", hc.TRACE_INFO);
        Requests requestLink = Requests.createRequests(the_architect);

        agentSmithCoreTest smithCore = new agentSmithCoreTest();
        AutomatonBehavior automaton = new AutomatonBehavior("/horde/minefield/andres/automatonTest.xml");
        Agent smith = new Agent ("Smith", automaton, smithCore, requestLink);
        hc.trace("Smith", "Agent Created", hc.TRACE_INFO);
        the_architect.addAgent(smith);
        hc.trace("the_architect", "Agent Smith addded", hc.TRACE_INFO);
        Agent othersmith = new Agent ("OtherSmith", automaton, smithCore, requestLink);
        the_architect.addAgent(othersmith);
        Agent moresmith = new Agent ("MoreSmith", automaton, smithCore, requestLink);
        the_architect.addAgent(moresmith);
        Agent xsmith = new Agent ("xSmith", automaton, smithCore, requestLink);
        the_architect.addAgent(xsmith);
        the_architect.startAgents();

        
        
    }

    public static class PruebahcVisual extends JFrame {

    private Dimension d = new Dimension(800, 700);
    private horrorControlGraphics p;
    private HorrorControl hc = null;

    public PruebahcVisual() {
        super();


        this.setLayout(new BorderLayout());
        p = horrorControlGraphics.getInstance();
        p.setSize(d);
        this.add(p,BorderLayout.CENTER);
        this.setSize(d);
        this.setTitle("Test Horror Control Graphics");
        this.setVisible(true);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }

    public PruebahcVisual(HorrorControl hc) {
        super();
        this.hc = hc;

        this.setLayout(new BorderLayout());
       
        try {
             p = hc.createGraphics();
            
        } catch (Exception e) {
            
        }
p.setSize(d);
        this.add(p,BorderLayout.CENTER);
        this.setSize(d);
        this.setTitle("Test Horror Control Graphics");
        this.setVisible(true);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }
}


}
